<template>
	<view class="w-container">
		<view class="content">
			<view class="typebox">
				<view class="cgray fz24">到账方式</view>
				<view class="flx-default">
					<tui-icon custom-prefix="lishitong" name="lishitong-weixin" size="20" color="#07C160"></tui-icon>
				    <view class="pl-10"></view>
				</view>
			</view>
			<view class="main-box">
				<view class="cgray fz24">提现金额</view>
				<view class="input-box">
					<NumberInput v-model="withdrawMoney" placeholder="请输入数字" mode="decimal2" />
				</view>
				<view class="flx-default fz24">
					<view class="cgray">剩余金额</view>
					<view class="cred pl-20">全部提现</view>
				</view>
				
				<view class="bt-w-box">
					<tui-button type="danger" width="670rpx" height="70rpx" size="28" @click="onWithdraw">提现</tui-button>
				</view>
				<view class="bott-txt" @click="onSee">
					提现记录
				</view>
			</view>
		</view>
	</view>

</template>

<script setup>
	import {
		ref, onMounted,nextTick
	} from 'vue'
	import {
		navigate
	} from '@/util/tools.js';
	
	import {
		technicianWithdrawal
	} from '@/api/other.js'
	import NumberInput from '@/components/NumberInput.vue'
	const withdrawMoney = ref('')
	
	
	const onWithdraw = async ()=>{
		let param={}
		
		param.price = withdrawMoney.value*1
		if(param.price <=1){
			uni.$uv.toast('提现金额不能少于1元')
		}
		param.type=1
		const res = await technicianWithdrawal(param)
		if(res.code==200){
			uni.$uv.toast('提现成功')
		}else{
			uni.$uv.toast('操作发生错误')
		}
	}
	
	
	const onSee=()=>{
		navigate('/pages-skilled/withdraw/record')
	}
	
</script>
<style>
	
</style>
<style lang="scss" scoped>
	
	.content{
	  background-color: #F6F4F7;
	}
	.typebox{
		margin-top: 20upx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20upx 30upx;
		background-color: #fff;
		box-sizing: border-box;
	}
	
	.main-box{
		background-color: #fff;
		margin-top:20upx;
		padding: 30upx;
		
	}
	
	.input-box{
		height: 150upx;
		margin-top: 20upx;
		
	}
	
	::v-deep .uni-input-placeholder{
		overflow: visible !important;
	}
	
	.bt-w-box{
		margin-top:40upx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.bott-txt{
		margin-top:10upx;
		display: flex;
		justify-content: center;
		align-items: center;
		color: red;
		font-size: 24upx;
	}
	
	
	

</style>